import { ref, onMounted, reactive, watch, nextTick } from 'vue'
import { ElMessage } from 'element-plus'
import { useRoute, useRouter } from 'vue-router'
import * as _ from 'lodash'
import { useTagsViewStore } from '../../../../store/modules/tagsView'
import {
  inStoreTypePageSelect,
  storePageSelect,
  storePositionPageSelect,
  rejectInbound,
  getInboundDetail,
  getInboundDetailMaterial,
  getGoodsStock,
  getStoreCodeList,
  getInOrOutStoreGoods,
  saveinboundCheck,
} from '../../../../api/store'
import { typePageSelect, brandPageSelect } from '../../../../api/goodsInfo'
import { ElTable } from 'element-plus'
import { Search } from '@element-plus/icons-vue'
import { useSettingStore } from '../../../../store/modules/setting'
export default function () {
  const loading = ref(false)
  const typeLoading = ref(false)
  const router = useRouter()
  const route = useRoute()
  const TagsViewStore = useTagsViewStore()
  // 单据来源
  const source = ref([
    { title: '系统单', value: 1 },
    { title: '工单', value: 2 },
    { title: 'ERP单据', value: 3 },
    { title: '仓库移动端单据', value: 4 },
    { title: '第三方系统单据', value: 5 },
  ])
  // 出库仓类型
  const storeType = ref([
    { title: '内部仓库', value: 0 },
    { title: '服务商-外部仓库', value: 1 },
    { title: '工程师-外部仓库', value: 2 },
  ])
  // 刷新页面
  const SettingStore = useSettingStore()
  const refresh = () => {
    SettingStore.setReload()
  }
  const newOutForm = ref({
    createTime:
      new Date(Date.now()).toISOString().split('T')[0] +
      ' ' +
      new Date(Date.now()).toTimeString().split(' ')[0], //单据日期
    delInboundMaterialIds: [], //删除的入库物料ID集合
    estimateTime: '', //	预计出库时间
    id: null, //
    inboundNo: '',
    inboundMaterialVos: [],
    remark: '', //出库备注
    reviewRemark: '', //	审核备注
    source: 1, //单据来源：1-系统单，2-工单，3-ERP单据，4-仓库移动端单据，5-第三方系统单据,示例值(1)
    storeType: 0, //仓库类型：0-内部仓库，1-服务商-外部仓库，2-工程师-外部仓库
    typeId: null, //出库类型ID
  })
  const rulesOutStore = reactive({
    typeId: [{ required: true, message: '入库类型', trigger: ['blur', 'change'] }],
    storeType: [{ required: true, message: '仓库类型', trigger: ['blur', 'change'] }],
  })
  // 获取入库下拉类型
  const outStoreType = ref([])
  const outStoreTypeValue = ref()
  const getoutStoreTypePageSelect = async (val) => {
    const data = {
      limit: 0,
      name: val,
      page: 0,
    }
    typeLoading.value = true
    await inStoreTypePageSelect(data).then((res) => {
      if (res) {
        if (res.data.code == 20000) {
          outStoreType.value = res.data.data.rows
        }
      }
    })
    typeLoading.value = false
  }
  const changeOutType = _.throttle((val: string) => {
    outStoreTypeValue.value = val
  }, 500)
  watch(outStoreTypeValue, (n) => {
    getoutStoreTypePageSelect(n)
  })

  //仓库及人员地址下拉列表查询
  const valuestoreEmpAddress = ref()
  const inputValueSch = _.throttle((val: string) => {
    valuestoreEmpAddress.value = val
  }, 500)
  watch(valuestoreEmpAddress, (n) => {
    getstorePageSelect(n)
  })

  const storeTypeChange = () => {
    modules.value = []
    orderGoodsList.value = orderGoodsList.value.map((o) => {
      o.storeId = null
      o.storePositionId = null
      o.storePositionList = []
      o.systemStock = null
      o.stockCodeVos = []
      o.stockCodeVosTemp = []
      return o
    })
    getstorePageSelect('')
  }
  const modules = ref([])
  const loadingEmp = ref(false)
  // 获取仓库下拉
  async function getstorePageSelect(val) {
    loadingEmp.value = true
    const data = {
      limit: 0,
      name: val,
      page: 0,
    }
    await storePageSelect(data, newOutForm.value.storeType).then((res) => {
      if (res.data.success) {
        modules.value = res.data.data.rows
      } else {
        if(res.data.isError) ElMessage({
          showClose: true,
          message: res.data.message,
          duration: 4000,
          offset: 200,
          type: 'error',
        })
      }
      loadingEmp.value = false
    })
  }
  const brandLoading = ref(false)
  const dataType = ref(null)
  const getGoodsDialog = ref(false)
  const multipleTableRef3 = ref<InstanceType<typeof ElTable>>()
  const orderGoodsVos3 = ref([]) //选择商品信息
  const orderGoodsList = ref([])
  const loading2 = ref(false)
  const pagination3 = ref()
  const input = ref('')
  const brandId = ref(null) // 品牌ID
  const itemIndex = ref(null)
  const goodsTypeId = ref('') // 商品分类ID
  const goodstableData = ref([])
  const typeTotal3 = ref(0)
  const goodstotal = ref(0)
  const currentPage = ref(1)
  const pageSize = ref(15)
  const brandVal = ref()
  // 搜索框下拉数据
  const brandOptions = ref([])
  // 点击商品类型
  const onClickItem = (val) => {
    itemIndex.value = val
    goodsTypeId.value = val
    getorderGoods()
  }
  const goodsType = ref(1) //商品类型：1-成品，2-配件
  // 获取商品信息列表
  const getorderGoods = async () => {
    const data = {
      brandId: brandId.value,
      keyword: input.value,
      limit: pagination3.value.size,
      page: pagination3.value.current,
      typeId: goodsTypeId.value,
    }
    loading2.value = true
    await getInOrOutStoreGoods(data, goodsType.value).then((res) => {
      loading2.value = false
      if (res.data.success) {
        goodstableData.value = res.data.data.rows
        typeTotal3.value = Number(res.data.data.total)
        // 重新渲染 商品信息选择
        goEditProductDialog()
      }
    })
  }
  //重新渲染
  const goEditProductDialog = async () => {
    // 点击打开 添加商品 获取已添加的渲染回显
    if (orderGoodsList.value.length > 0) {
      orderGoodsVos3.value = JSON.parse(JSON.stringify(orderGoodsList.value))
    }
    // 重新渲染 商品信息选择
    orderGoodsVos3.value.map((goods) => {
      goodstableData.value.find((item) => {
        if (item.specId === goods.goodsSpecId) {
          nextTick(() => {
            multipleTableRef3.value!.toggleRowSelection(item, undefined)
          })
        }
      })
    })
  }
  // current-page 改变时触发
  const handleCurrentChange = (page: number) => {
    currentPage.value = page
    getTypeData()
  }
  // 获取商品类型
  const typeloading = ref(false)
  const getTypeData = async () => {
    typeloading.value = true
    const data = {
      limit: pageSize.value,
      name: '',
      page: currentPage.value,
    }
    await typePageSelect(data).then((res) => {
      dataType.value = res.data.data.rows
      goodstotal.value = Number(res.data.data.total)
      typeloading.value = false
    })
  }
  // 查看图片
  const dialogVisible = ref(false)
  const lookImgUrl = ref(null)
  const lookPic = (img) => {
    lookImgUrl.value = img
    dialogVisible.value = true
  }
  // 搜索品牌下拉数据输入搜索
  const searchBrandSelect = _.throttle((query: string) => {
    brandVal.value = query
  }, 500)
  watch(brandVal, (n) => {
    getBrandOptions(n)
  })
  // 获取品牌下拉数据
  const getBrandOptions = async (name) => {
    const data = {
      limit: 0,
      name: name,
      page: 0,
    }
    brandLoading.value = true
    await brandPageSelect(data).then((res) => {
      brandOptions.value = res.data.data.rows
    })
    brandLoading.value = false
  }
  // 商品信息列表勾选 全选
  const selectAllgoodsinformation = (val) => {
    if (val.length > 0) {
      val.map((row) => {
        const result = orderGoodsVos3.value.some((o) => row.specId == o.goodsSpecId)
        const item = {
          image: row.image,
          storeId: null,
          storePositionId: null,
          code: row.code,
          storePositionList: [],
          stockCodeVos: [],
          stockCodeVosTemp: [],
          unit: row.unit,
          id: null,
          goodsId: row.id,
          goodsBrand: row.brand,
          goodsModel: row.model,
          goodsName: row.name,
          goodsSpecId: row.specId,
          remark: '',
          goodsSpecName: row.specName,
          price: row.price,
          goodsType: row.type,
          qty: 1,
          type: goodsType.value,
        }
        if (!result) {
          orderGoodsVos3.value.push(item)
        }
      })
    } else if (val.length == 0) {
      goodstableData.value.map((row) => {
        orderGoodsVos3.value = orderGoodsVos3.value.filter((o) => o.goodsSpecId != row.specId)
      })
    }
  }
  // 勾选 商品信息
  const handleClickgoodsinformation = (val, row) => {
    const item = {
      image: row.image,
      storeId: null,
      storePositionId: null,
      storePositionList: [],
      stockCodeVos: [],
      stockCodeVosTemp: [],
      code: row.code,
      unit: row.unit,
      id: null,
      goodsId: row.id,
      goodsBrand: row.brand,
      goodsModel: row.model,
      goodsName: row.name,
      goodsSpecId: row.specId,
      remark: '',
      goodsSpecName: row.specName,
      price: row.price,
      goodsType: row.type,
      qty: 1,
      type: goodsType.value,
    }
    const result = val.some((item) => item.specId == row.specId) //判断是否是 选中
    if (result) {
      orderGoodsVos3.value.push(item)
    } else {
      orderGoodsVos3.value = orderGoodsVos3.value.filter((o) => o.goodsSpecId != row.specId)
    }
  }
  //   商品选择弹窗
  const addGoodsList = () => {
    getGoodsDialog.value = true
    orderGoodsVos3.value = []
    new Promise(() => {
      getTypeData()
      getBrandOptions('')
      nextTick(() => {
        getorderGoods()
      })
    })
  }
  const detelePro = (index) => {
    orderGoodsList.value = orderGoodsList.value.filter((o, i) => i != index)
  }
  // 确定 选择的商品
  const onCommit = () => {
    // 工单编码商品类型type：1-客户已登记商品，2-未登记商品，3-商品信息,示例值(1)
    if (orderGoodsList.value.length > 0) {
      // 商品信息
      if (orderGoodsVos3.value.length > 0) {
        const arr = [] //旧
        const arr2 = [] //新

        orderGoodsVos3.value.filter((goods) => {
          const result = orderGoodsList.value.some((i) => i.goodsSpecId == goods.goodsSpecId)
          if (result) {
            arr.push(...orderGoodsList.value.filter((i) => i.goodsSpecId == goods.goodsSpecId))
          } else {
            arr2.push(goods)
          }
        })
        orderGoodsList.value = [...arr, ...arr2]
      }
    } else {
      if (orderGoodsVos3.value.length > 0) {
        orderGoodsList.value = orderGoodsVos3.value
      }
    }
    orderGoodsVos3.value = []
    getGoodsDialog.value = false
  }
  const onCancel = () => {
    getGoodsDialog.value = false
    orderGoodsVos3.value = []
  }
  // 判断列表是否启用仓位
  const faultsStorePositionFun = (id) => {
    if (id) {
      for (const obj of modules.value) {
        if (obj.id == id) {
          return !obj.enableStorePosition
        }
      }
    }
    return true
  }
  // 仓位选择输入搜索
  const valuestorePosition = ref({ val: '', id: null, index: null })
  const changeSelestorePositionId = _.throttle((val, id, index = null) => {
    valuestorePosition.value.val = val
    valuestorePosition.value.id = id
    valuestorePosition.value.index = index
  }, 500)
  // 监听仓位选择输入搜索变化
  watch(
    () => valuestorePosition.value.val,
    (n) => {
      getstorePositionPageSelect(n, valuestorePosition.value.id, valuestorePosition.value.index)
    },
  )

  // 仓位下拉数据
  const getstorePositionPageSelect = async (val: string, storeId, index = null) => {
    const data = {
      limit: 0,
      name: val,
      page: 0,
    }
    if (storeId) {
      await storePositionPageSelect(data, storeId).then((res) => {
        if (res) {
          if (index || index === 0) {
            orderGoodsList.value[index].storePositionList = res.data.data.rows
          }
        }
      })
    }
  }
  // 列表仓位变化
  const changeSeleStoreId = (row, index) => {
    orderGoodsList.value[index].storePositionId = null
    if (!faultsStorePositionFun(row.storeId)) {
      getstorePositionPageSelect('', row.storeId, index)
      // orderGoodsList.value[index].stockCodeVos = []
      // orderGoodsList.value[index].stockCodeVosTemp = []
    } else {
      changeSelestorePositionIdRow(row, index)
    }
  }
  //仓库下拉变化
  const changeSelestorePositionIdRow = (row, index) => {
    if (row.storeId) {
      // orderGoodsList.value[index].stockCodeVos = []
      // orderGoodsList.value[index].stockCodeVosTemp = []
      const data = {
        goodsId: row.goodsId, //商品ID
        goodsSpecId: row.goodsSpecId, //商品规格ID
        storeId: row.storeId, //仓库ID
        storePositionId: row.storePositionId, //仓库仓位ID，当仓库启用仓位时，此字段必传
        type: row.type, //商品类型：1-成品，2-配件
      }
      orderGoodsList.value[index].systemStock = 0
      if (!faultsStorePositionFun(row.storeId)) {
        data.storePositionId = row.storePositionId
      }
      getGoodsStock(data).then((res) => {
        if (res) {
          if (res.data.code == 20000) {
            if (res.data.data.row.id) {
              orderGoodsList.value[index].price = res.data.data.row.price
            }
            orderGoodsList.value[index].systemStock = res.data.data.row.systemStock
          }
        }
      })
    }
  }
  // 获取一物一码
  const getCodeDialog = ref(false) //弹窗
  const codeRowObj = ref(null)
  // 点击一物一码详情
  const getCode = (row, index) => {
    codeRowObj.value = { ...row, index: index }
    if (row.stockCodeVos.length > 0) {
      getCodeDialog.value = true
    } else {
      getCodeDataShow()
    }
  }
  // 在库选择弹窗
  const SelectCodeDialog = ref(false)
  const stockCodeVosTemp = ref([]) //在库选择的选中数据
  // 点击在库选择
  const getCodeDataShow = () => {
    stockCodeVosTemp.value = orderGoodsList.value[codeRowObj.value.index].stockCodeVosTemp
    SelectCodeDialog.value = true
    nextTick(() => {
      getInStoreCodeListData()
    })
  }
  const keywordCode = ref('')
  const paginationRef = ref()
  const totalCode = ref(0)
  const getListCode = ref([])
  const selectCodeRef = ref()
  const getStoreCodeListLoading = ref(false)
  const getInStoreCodeListData = async () => {
    const data = {
      goodsId: codeRowObj.value.goodsId,
      goodsSpecId: codeRowObj.value.goodsSpecId,
      keyword: keywordCode.value,
      limit: paginationRef.value.size,
      page: paginationRef.value.current,
      storeId: null,
      storePositionId: null,
      type: codeRowObj.value.type,
    }
    getStoreCodeListLoading.value = true
    await getStoreCodeList(data).then((res) => {
      if (res) {
        totalCode.value = Number(res.data.data.total)
        getListCode.value = res.data.data.rows
        // // 重新渲染 商品信息选择
        stockCodeVosTemp.value.map((goods) => {
          getListCode.value.map((item) => {
            if (item.id === goods.id) {
              nextTick(() => {
                selectCodeRef.value!.toggleRowSelection(item, undefined)
              })
            }
          })
        })
      }
    })
    getStoreCodeListLoading.value = false
  }
  const selectAllCodeinformation = (val) => {
    if (val.length > 0) {
      val.map((row) => {
        const result = stockCodeVosTemp.value.some((o) => row.id == o.id)
        if (!result) {
          orderGoodsList.value[codeRowObj.value.index].stockCodeVosTemp.push(row)
        }
      })
    } else if (val.length == 0) {
      getListCode.value.map((row) => {
        orderGoodsList.value[codeRowObj.value.index].stockCodeVosTemp = orderGoodsList.value[
          codeRowObj.value.index
        ].stockCodeVosTemp.filter((o) => o.id != row.id)
      })
    }
  }
  const handleClickCodeinformation = (val, row) => {
    const result = val.some((item) => item.id == row.id) //判断是否是 选中
    if (result) {
      orderGoodsList.value[codeRowObj.value.index].stockCodeVosTemp.push(row)
    } else {
      orderGoodsList.value[codeRowObj.value.index].stockCodeVosTemp = orderGoodsList.value[
        codeRowObj.value.index
      ].stockCodeVosTemp.filter((o) => o.id != row.id)
    }
  }
  // 确定选择在库编码
  const confirmSelectCode = () => {
    orderGoodsList.value[codeRowObj.value.index].stockCodeVosTemp = stockCodeVosTemp.value
    SelectCodeDialog.value = false
    getCodeDialog.value = true
  }
  // 选择删除选中编码
  const deteleCode = (index) => {
    orderGoodsList.value[codeRowObj.value.index].stockCodeVosTemp = orderGoodsList.value[
      codeRowObj.value.index
    ].stockCodeVosTemp.filter((o, n) => n != index)
  }
  // 确定选择选中的编码
  const confirmCode = () => {
    if (
      codeRowObj.value.qty < orderGoodsList.value[codeRowObj.value.index].stockCodeVosTemp.length
    ) {
      ElMessage({
        showClose: true,
        message: '录入编码不能超过出库编码总数',
        duration: 4000,
        offset: 200,
        type: 'error',
      })
      return
    }
    if (orderGoodsList.value[codeRowObj.value.index].stockCodeVosTemp.length == 0) {
      orderGoodsList.value[codeRowObj.value.index].stockCodeVos = []
    } else {
      orderGoodsList.value[codeRowObj.value.index].stockCodeVos = orderGoodsList.value[
        codeRowObj.value.index
      ].stockCodeVosTemp.map((o) => {
        return { code: o.code }
      })
    }

    getCodeDialog.value = false
  }
  // 审核弹窗
  const checkDialog = ref(false)
  const onclickSave = async () => {
    if (!ruleFormRef.value) return
    await ruleFormRef.value.validate((valid) => {
      if (valid) {
        checkDialog.value = true
      }
    })
  }
  // 驳回出库单
  const rejectDialog = ref(false)
  const onrejectOutbound = async () => {
    // if (!newOutForm.value.reviewRemark) {
    //     ElMessage({
    //         showClose: true,
    //         message: '请填写驳回备注！',
    //         duration: 3000,
    //         offset: 200,
    //         type: 'error'
    //     })
    //     return
    // }
    loading.value = true
    await rejectInbound({ remark: newOutForm.value.reviewRemark }, route.params.id).then((res) => {
      if (res) {
        if(res.data.isError) ElMessage({
          showClose: true,
          message: res.data.message,
          duration: 4000,
          offset: 200,
          type: res.data.success ? 'success' : 'error',
        })
        if (res.data.success) {
          TagsViewStore.delView(route.path)
          router.push('/storage/outb')
          refresh()
        }
      }
    })
    loading.value = false
  }
  const ruleFormRef = ref()

  // 提交类型：1-保存，2-审核
  const onSaveAudit = async (type) => {
    if (!ruleFormRef.value) return
    await ruleFormRef.value.validate((valid) => {
      if (valid) {
        loading.value = true
        if (orderGoodsList.value.length > 0) {
          newOutForm.value.inboundMaterialVos = orderGoodsList.value.map((o) => {
            return {
              goodsId: o.goodsId, //物料ID
              goodsSpecId: o.goodsSpecId, //物料规格ID
              id: o.id, //
              price: o.price, //物料单价
              qty: o.qty, //物料出/入库数量,示例1
              remark: o.remark, //物料出/入库备注
              stockCodeVos: o.stockCodeVos,
              storeId: o.storeId, //仓库ID
              storePositionId: o.storePositionId, //仓库仓位ID，当仓库启用仓位时，此字段必传
              type: o.type, //	物料类型：1-成品 ，2-备件
            }
          })
        }
        // 删除的入库物料ID集合
        newOutForm.value.delInboundMaterialIds = orderGoodsListtem.value.filter((i) => {
          const result = orderGoodsList.value.some((o) => o.id == i.id)
          if (!result) {
            return i.id
          }
        })
        newOutForm.value.delInboundMaterialIds = newOutForm.value.delInboundMaterialIds.map(
          (o) => o.id,
        )
        saveinboundCheck(newOutForm.value, type).then((res) => {
          if (res) {
            if(res.data.isError) ElMessage({
              showClose: true,
              message: res.data.message,
              duration: 4000,
              offset: 200,
              type: res.data.success ? 'success' : 'error',
            })
            if (res.data.success) {
              TagsViewStore.delView(route.path)
              router.push('/storage/intb')
              refresh()
            }
          }
        })
        loading.value = false
      }
    })
  }
  //商品信息
  const orderGoodsListtem = ref([]) //已经存在的商品
  const getoutStoreList = async () => {
    loading.value = true
    if (route.params.id) {
      await getInboundDetailMaterial(route.params.id).then((res) => {
        if (res) {
          if (res.data.code == 20000) {
            orderGoodsList.value = res.data.data.row
            orderGoodsListtem.value = res.data.data.row
            orderGoodsList.value = orderGoodsList.value.map((o, index) => {
              const stockCodeVosTemp = o.stockCodeVos.map((n) => {
                return {
                  ...n,
                  goodsBrand: o.goodsBrand,
                  goodsName: o.goodsName,
                  goodsModel: o.goodsModel,
                  goodsSpecName: o.goodsSpecName,
                  store: o.store,
                  storePosition: o.storePosition,
                }
              })
              getstorePositionPageSelect('', o.storeId, index)
              return { ...o,  unit:o.goodsUnit, stockCodeVosTemp: stockCodeVosTemp }
            })
          } else {
            if(res.data.isError)ElMessage({
              showClose: true,
              message: res.data.message,
              type: 'error',
              duration: 4000,
            })
          }
        }
      })
    }
    loading.value = false
  }
  // 根据仓库ID获取仓库详情
  const getDetailStoreItem = async () => {
    if (route.params.id) {
      loading.value = true
      await getInboundDetail(route.params.id).then((res) => {
        if (res) {
          if (res.data.code == 20000) {
            const temp = res.data.data.row
            newOutForm.value = {
              createTime: temp.createTime, //单据日期
              estimateTime: temp.estimateTime, //	预计出库时间
              id: temp.id, //
              delInboundMaterialIds: [],
              inboundNo: temp.inboundNo,
              inboundMaterialVos: [],
              remark: temp.remark, //单据备注
              reviewRemark: temp.reviewRemark, //	审核备注
              source: temp.source, //单据来源：1-系统单，2-工单，3-ERP单据，4-仓库移动端单据，5-第三方系统单据,示例值(1)
              storeType: temp.storeType, //仓库类型：0-内部仓库，1-服务商-外部仓库，2-工程师-外部仓库
              typeId: temp.typeId, //出库类型ID
            }
            getstorePageSelect('')
          } else {
            if(res.data.isError)ElMessage({
              showClose: true,
              message: res.data.message,
              type: 'error',
              duration: 4000,
              offset: 200,
            })
          }
        }
      })
      loading.value = false
    }
  }
  onMounted(() => {
    if (route.params.id) {
      getDetailStoreItem()
      getoutStoreList()
    }
  })
  // 取消
  const onCancelIntb = () => {
    ruleFormRef.value?.resetFields()
    newOutForm.value.inboundMaterialVos = []
    TagsViewStore.delView(route.path)
    router.push('/storage/intb')
  }
  return {
    loading,
    newOutForm,
    rulesOutStore,
    onCancelIntb,
    checkDialog,
    faultsStorePositionFun,
    changeSelestorePositionId,
    source,
    detelePro,
    getStoreCodeListLoading,
    onclickSave,
    onrejectOutbound,
    storeTypeChange,
    changeOutType,
    outStoreType,
    typeLoading,
    getoutStoreTypePageSelect,
    typeloading,
    orderGoodsList,
    multipleTableRef3,
    getstorePageSelect,
    storeType,
    inputValueSch,
    modules,
    addGoodsList,
    onCommit,
    onCancel,
    itemIndex,
    getGoodsDialog,
    dialogVisible,
    lookImgUrl,
    dataType,
    onClickItem,
    handleCurrentChange,
    currentPage,
    pageSize,
    goodstotal,
    loading2,
    brandLoading,
    lookPic,
    brandId,
    searchBrandSelect,
    getorderGoods,
    pagination3,
    brandOptions,
    input,
    Search,
    goodstableData,
    selectAllgoodsinformation,
    typeTotal3,
    handleClickgoodsinformation,
    changeSeleStoreId,
    changeSelestorePositionIdRow,
    getCodeDialog,
    getCode,
    codeRowObj,
    SelectCodeDialog,
    getCodeDataShow,
    keywordCode,
    ruleFormRef,
    paginationRef,
    totalCode,
    getInStoreCodeListData,
    goodsType,
    getListCode,
    selectAllCodeinformation,
    handleClickCodeinformation,
    selectCodeRef,
    confirmSelectCode,
    deteleCode,
    confirmCode,
    onSaveAudit,
    rejectDialog,
  }
}
